import axios from "axios";
const request = axios.create({
  baseURL: "http://172.16.2.236:3000",
  // baseURL: "localhost:8080",
  timeout: 5000,
});
request.interceptors.request.use((config) => {
  const token = localStorage.getItem("token");
  if (token) {
    config.headers.Authorization = `Bearer ${token}`;
  }
  return config;
});
request.interceptors.response.use(
  (res) => {
    return res.data;
  },
  (err) => {
    return Promise.reject(err);
  }
);
export default request;
